package org.example.constants;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

public interface CommonConstants {

    public static final String API_VERSION = "v1";


    @Getter
    @AllArgsConstructor
    enum ServiceName {

        GATEWAY_SERVICE("cqt-getaway"),
        ACCOUNT_SERVICE("cqt-account"),
        SSO_SERVICE("cqt-sso");
        private String serviceName;

        public static boolean isIn(String serviceName) {
            if (StringUtils.isBlank(serviceName))
                return false;
            for (ServiceName name : ServiceName.values())
                if (name.getServiceName().equals(serviceName))
                    return true;
            return false;
        }
    }


    public static final String API_INTERNAL_HEADER_NAME = "x-api-internal";

    public static final String API_HEADER_NAME = "Authorization";
}
